projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca9193d
)
efi_memory: do parameter checks first
author
[email protected]
<
[email protected]
>
Fri, 21 Jul 2017 17:04:33 +0000
(19:04 +0200)
committer
Alexander Graf
<
[email protected]
>
Mon, 24 Jul 2017 12:46:01 +0000
(14:46 +0200)
The parameter checks should be done first.
Signed-off-by: Heinrich Schuchardt <
[email protected]
>
Signed-off-by: Alexander Graf <
[email protected]
>
lib/efi_loader/efi_memory.c
patch
|
blob
|
history
diff --git
a/lib/efi_loader/efi_memory.c
b/lib/efi_loader/efi_memory.c
index 5c53aaafdb18e8efe8a8167e513bc5e231bb2eea..c56653f4978f2db0c32ef6faa9fe172d97390bbe 100644
(file)
--- a/
lib/efi_loader/efi_memory.c
+++ b/
lib/efi_loader/efi_memory.c
@@
-407,6
+407,9
@@
efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
map_size = map_entries * sizeof(struct efi_mem_desc);
+ if (provided_map_size < map_size)
+ return EFI_BUFFER_TOO_SMALL;
+
*memory_map_size = map_size;
if (descriptor_size)
@@
-415,9
+418,6
@@
efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
if (descriptor_version)
*descriptor_version = EFI_MEMORY_DESCRIPTOR_VERSION;
- if (provided_map_size < map_size)
- return EFI_BUFFER_TOO_SMALL;
-
/* Copy list into array */
if (memory_map) {
/* Return the list in ascending order */